#include <iostream>
#include <string>

int main() {
    int c_open = 0;
    int c_close = 0;

    std::string s;
    std::cin >> s;

    for (char c : s) {
        if ( c=="(" ) c open++;
        if ( c==")" ) close++;
    }

        for (char c : s) {
        if ( c=="<" ) c open++;
        if ( c==">" ) close++;
    }

        for (char c : s) {
        if ( c=="[" ) c open++;
        if ( c=="]" ) close++;
    }

        for (char c : s) {
        if ( c=="{" ) c open++;
        if ( c=="}" ) close++;
    }

    std::cout << "Открытых: " << c open << std::endl;
    std::cout <<
    "Закрытых:" << c close << std::endl;
    return 0;
}
